-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement FromStr for Path #1480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Approving, but since Shoaib is the customer for this, I think he should have the final say.
.changelog/unreleased/improvements/ics24-host-path/1460-path-fromstr.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautifully done @seanchen1991! I added some comments. This is already looking great but I'm also trying to use it with basecoin to see if there is anything we can improve.
modules/src/ics24_host/path.rs
Outdated
Path::Ports(port_id) => write!(f, "ports/{}", port_id), | ||
Path::Sequences(sequence) => write!(f, "sequences/{}", sequence), | ||
Path::ChannelEnds(port_id, channel_id) => { | ||
write!(f, "channelEnds/ports/{}/channels/{}", port_id, channel_id) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question (@ancazamfir @adizere) - Why do some of our paths diverge from the spec, eg. commitments/ports/{identifier}/channels/{identifier}/sequences/{identifier}
v/s spec commitments/ports/{identifier}/channels/{identifier}/packets/{sequence}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm interesting point, I wasn't aware there's a divergence!
I think the ibc-rs implementation consider as ground truth the ibc-go impl:
which diverges from the spec. It would be worthwhile to highlight this problem in the spec repo.
.changelog/unreleased/improvements/ics24-host-path/1460-path-fromstr.md
Outdated
Show resolved
Hide resolved
…fromstr Merging in upstream changes.
…th-fromstr Pulling in upstream changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sean! 🙏
* Add FromStr<Path> and initial test * Add `parse_client_type` fn and associated test * Add `parse_client_paths` fn * Add `parse_connections` fn * Add more Path parsing logic * Complete Path FromStr logic * Add more Path parsing unit tests * Add changelog entry * Fix changelog entry formatting * Remove stale changelog entry * Move changelog entry under `ibc` component * Move Channels and Sequences to a private enum Co-authored-by: Romain Ruetschi <[email protected]>
Closes: #1460
Description
Implements the
FromStr
trait forPath
, along with associated unit tests. This is functionality needed in order to address informalsystems/basecoin-rs#14.For contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.